package cn.besbing.server.service.primary;


import cn.besbing.model.entities.primary.Analysis;
import cn.besbing.model.entities.primary.AnalysisKey;
import cn.besbing.model.mapper.primary.AnalysisMapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PrimaryAnalysisServiceImpl {

    @Autowired(required = false)
    AnalysisMapper analysisMapper;

    public Analysis getAnalysisByPrimarykey(JSONObject analysisJson){
        AnalysisKey analysisKey = new AnalysisKey();
        analysisKey.setName(analysisJson.getString("analysis"));
        analysisKey.setVersion(Long.valueOf(analysisJson.getString("version")));
        return analysisMapper.selectByPrimaryKey(analysisKey);
    }


}
